import java.util.Arrays;
import java.util.Scanner;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //输入参数********************************************
        Scanner scanner = new Scanner(System.in);
        int people = scanner.nextInt();
        double fullScore = scanner.nextInt();
        int[] score = new int[people];
        for (int i = 0; i < people; i++){
            score[i] = scanner.nextInt();
        }
        double[] per = new double[3];
        for (int i = 0;  i < 3; i++){
            per[i] = scanner.nextInt();
        }
        int[] sub = new int[4];
        for (int i = 0; i < 4; i++){
            sub[i] = scanner.nextInt();
        }

        //分数转化*********************************************
        if (fullScore < 100){
            double a = fullScore / 100;
            for (int i = 0; i < people; i++){
//                score[i] = (int) (score[i] / a);
                score[i] = (int)Math.floor(score[i] / a);
            }
        }else if (fullScore > 100) {
            double b = fullScore / 100;
            for (int i = 0; i < people; i++){
//                score[i] = score[i] / b;
                score[i] = (int)Math.floor(score[i] / b);
            }

        }

        //人数转化*******************************************
        int n1 = (int) Math.ceil(people*(per[0]/100));
        int n2 = (int) Math.ceil(people*(per[1]/100));
        int n3 = (int) Math.ceil(people*(per[2]/100));
        int n4 = people - n1 - n2 - n3;

        //开始转换********************************************
//        for (int i = 0; i < n1; i++){
//            score[i] = (int)(score[i] - sub[0]);
//            System.out.print(score[i] + "  ");
//        }
//        for (int i = n1; i < n2; i++){
//            score[i] = (int)(score[i] - sub[1]);
//            System.out.print(score[i] + "  ");
//        }
//        for (int i = n2; i < n3; i++){
//            score[i] = (int)(score[i] - sub[2]);
//            System.out.print(score[i] + "  ");
//        }
//        for (int i = n3; i < n4; i++){
//            score[i] = (int)(score[i] - sub[3]);
//            System.out.print(score[i] + "  ");
//        }

        int num = 0;
        while (num < people) {
            for (int i = 0; i < people; i++) {
                if (num < n1) {
                    score[i] = (int) (score[i] - sub[0]);
                    System.out.print(score[i] + "  ");
                    num++;
                } else if (num < (n1 + n2)) {
                    score[i] = (int) (score[i] - sub[0] - sub[1]);
                    System.out.print(score[i] + "  ");
                    num++;
                } else if (num < n1 + n2 + n3) {
                    score[i] = (int) (score[i] - sub[0] - sub[1] - sub[2]);
                    System.out.print(score[i] + "  ");
                    num++;
                } else if (num < people) {
                    score[i] = (int) (score[i] - sub[0] - sub[1] - sub[2] - sub[3]);
                    System.out.print(score[i] + "  ");
                    num++;
                }
            }
        }
    }
}